package com.lqwu.mallchatserver.user.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.lqwu.mallchatserver.common.domain.vo.request.CursorPageBaseReq;
import com.lqwu.mallchatserver.common.domain.vo.request.PageBaseReq;
import com.lqwu.mallchatserver.common.domain.vo.response.CursorPageBaseResp;
import com.lqwu.mallchatserver.common.domain.vo.response.PageBaseResp;
import com.lqwu.mallchatserver.user.model.dto.FriendApplyReq;
import com.lqwu.mallchatserver.user.model.dto.FriendApproveReq;
import com.lqwu.mallchatserver.user.model.dto.FriendCheckReq;
import com.lqwu.mallchatserver.user.model.entry.UserFriend;
import com.lqwu.mallchatserver.user.model.vo.FriendApplyResp;
import com.lqwu.mallchatserver.user.model.vo.FriendCheckResp;
import com.lqwu.mallchatserver.user.model.vo.FriendResp;
import com.lqwu.mallchatserver.user.model.vo.FriendUnreadResp;

import javax.validation.Valid;

/**
 * @author : limeng
 * @description : 好友
 * @date : 2023/07/19
 */
public interface FriendService extends IService<UserFriend> {
    /**
     * 检查用户是否为好友
     * @param currentUid
     * @param req
     * @return
     */
    FriendCheckResp check(Long currentUid,  FriendCheckReq req);

    /**
     * 好友申请
     * @param currentUid
     * @param req
     */
    void apply(Long currentUid, FriendApplyReq req);

    /**
     * 分页查询好友申请
     *
     * @param request 请求
     * @return {@link PageBaseResp}<{@link FriendApplyResp}>
     */
    PageBaseResp<FriendApplyResp> pageApplyFriend(Long uid, PageBaseReq request);

    /**
     * 根据用户id获取申请未读数
     * @param uid
     * @return
     */
    FriendUnreadResp unread(Long uid);

    /**
     * 用户同意好友申请
     * @param uid
     * @param request
     */
    void applyApprove(Long uid, FriendApproveReq request);

    /**
     * 删除好友
     * @param uid
     * @param friendUid
     */
    void deleteFriend(Long uid, Long friendUid);

    /**
     * 游标翻页获取好友列表
     * @param uid
     * @param request
     * @return
     */
    CursorPageBaseResp<FriendResp> friendList(Long uid, CursorPageBaseReq request);
}
